<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>购买设备记录表</title>
		<style type="text/css">
		</style>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/admin_css/list_style.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/layui/css/layui.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/niubility.css"/>
		<script type="text/javascript" src="../../../resource/layui/layui.js"></script>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/bootstrap.css"/>
	</head>
	<body>
		<!--详情：弹出层-->
		<div class="popUp" id="popUp">
			<table class="table table-bordered table-hover"></table>
			<table class="table table-bordered table-hover"></table>
			<table class="table table-bordered table-hover"></table>
		</div>
	
		<div class="bs">
			<input type="button" id="totalSelection" value="全部选中" />
			<input type="button" id="sure" value="审核" />
		</div>
		
		<table class="layui-table">
			<!-- 数据的改变区域 -->
			<tbody id="infoBox"></tbody>
			<!--用来分页的div-->
			<div class="fenBox">
				<div id="pagination1"></div>
			</div>
		</table>

		<script type="text/javascript" src="../../../resource/js/jquery.min.js"></script>
		<!--静态路径: 应该放在 渲染列表 和 审核功能的前面 -->
		<script src="../../../resource/js/static_url.js"></script>
		<!-- 共同一套：生成信息列表 + 弹出层退回去的代码 + 全选按钮-->
		<script src="../../../resource/js/admin_js/admin_review_list.js"></script>
		<!--  审核功能： 购买 、 调入 、调出 、 报损报废  -->
		<script src="../../../resource/js/admin_js/admin_review_four.js"></script>

		<script>
			//（1）初始化购买审核列表信息
            myAjax_list_popup(admin_purchase,'1');
            //（2）审核
            $("#sure").click(function(){
                //参数为： 批量审核post的那种
                examine(admin_purchse_review,admin_purchase);// 第一个参数“post”提交  ， 第二个参数“ 渲染列表 ”
                $("#totalSelection").val("全部选中");
                flag = 1;
            });
            //（3）详情按钮----这块显示信息
            function details(that){
                //拿出一个id ,点击第几个，我就拿第几条数据中一个id
                var ids = $(that).attr("data-id");
                $.ajax({
                    url: admin_purchase_details+ids,
                    type:"GET",
                    async: true,
                    dataType:"json",
                    success: function(info){
                        if(info.code != 0){
                            layui.use('layer', function(){
                                var layer = layui.layer;
                                layer.msg(info.msg, {skin:'tip_position',time:'3000'});
                            });
                            return;
                        }

                        var obj1 = info.data;
                        var str1 = "";
                        str1+=
                            '<tr>'+
                            '<td>设备编号</td>'+
                            '<td>设备名称</td>'+
                            '<td>当前使用状态</td>'+
                            '<td>当前使用人</td>'+
                            '<td>存放地点</td>'+
                            '<td>细类别</td>'+
                            '</tr>'+
                            '<tr>'+
                            '<td>'+obj1.equipmentNo+'</td>'+
                            '<td>'+obj1.equipmentName+'</td>'+
                            '<td>'+obj1.useStatus+'</td>'+
                            '<td>'+obj1.userName+'</td>'+
                            '<td>'+obj1.place+'</td>'+
                            '<td>'+obj1.equipmentCategory+'</td>'+
                            '</tr>';
                        var str2 ="";
                        str2+=
                            '<tr>'+

                            '<td>单价</td>'+
                            '<td>型号</td>'+
                            '<td>折旧状态</td>'+
                            '<td>折旧年限</td>'+
                            '<td>出货票号码</td>'+
                            '</tr>'+
                            '<tr>'+
                            '<td>'+obj1.price+'</td>'+
                            '<td>'+obj1.type+'</td>'+
                            '<td>'+obj1.depreciationStatus+'</td>'+
                            '<td>'+obj1.depreciationPeriod+'</td>'+
                            '<td>'+obj1.shippingNo+'</td>'+
                            '</tr>';
                        var str3 = "";
                        str3+=
                            '<tr>'+
                            '<td>供货单位</td>'+
                            '<td>进货日期</td>'+
                            '<td>用途</td>'+
                            '<td>出产厂家</td>'+
                            '<td>制造号</td>'+
                            '<td>利用率</td>'+
                            '</tr>'+
                            '<tr>'+
                            '<td>'+obj1.deliveryUnit+'</td>'+
                            '<td>'+obj1.purchaseDate+'</td>'+
                            '<td>'+obj1.application+'</td>'+
                            '<td>'+obj1.manufacturer+'</td>'+
                            '<td>'+obj1.manufacturerNo+'</td>'+
                            '<td>'+obj1.shippingNo+'</td>'+
                            '</tr>';
                        $("#popUp table").eq(0).html(str1);
                        $("#popUp table").eq(1).html(str2);
                        $("#popUp table").eq(2).html(str3);
                        //让内容以弹出层的方式显示出来。
                        $("#popUp").attr({"class":"popUpClick"});
                        // 动态计算 #popUp 的宽度
                        var width_fen = parseInt( $("#popUp").css("width") );
                        width_fen = 801;
                        $("#popUp")[0].style.marginLeft = -width_fen/2-120-60+'px';
                    },
                    error:function(){
                        layui.use('layer', function(){
                            var layer = layui.layer;
                            layer.msg('系统错误！！！', {skin:'tip_position',time:'3000'});
                        });
                    }
                }); //ajax结束

            }
		</script>
	</body>
</html>
